package entity;

public class EuintRegister extends ENumberRegister {
	private long value = -1l;
	
	public EuintRegister(String name, int address, String dataType,
			String description, String unit, double min, double max) {
		super(name, address, dataType, description, true, unit, min, max);
	}

	public void setValue(byte b0, byte b1, byte b2, byte b3) {
		long newValue = ((long) b0 & 0xff) + (((long) (b1 & 0xff)) << 8)
				+ (((long) (b2 & 0xff)) << 16) + (((long) (b3 & 0xff)) << 24);
		
		this.value = newValue;
		setChanged();
		notifyObservers(value);
	}
	
	public Object getValue() {
		return value;
	}
        
        @Override
        public String toString(){
            return String.valueOf(value);     
        }
}
